#include "bga/graphics/QuadDrawable.h"
#include <GL/glew.h>
#include <iostream>

using namespace std;

namespace bga
{

float QuadDrawable::vertex[4*3] = {-1.0f, -1.0f, 0.0f,
                     -1.0f, 1.0f, 0.0f,
                     1.0f, 1.0f, 0.0f,
                     1.0f, -1.0f, 0.0f};


float QuadDrawable::texCoord[4*2] = {0.0, 0.0,
                         0.0, 1.0,
                         1.0, 1.0,
                         1.0, 0.0};

unsigned short QuadDrawable::index[4] = {0, 1, 2, 3};



QuadDrawable::QuadDrawable() : Drawable()
{
    /*this->vertexArray = vertex;
    this->texCoordArray = texCoord;
    this->indexArray = index;

    this->vertexArraySize = 4 * 3;
    this->texCoordArraySize = 4 * 2;
    this->indexArraySize = 4;

    this->vertexArraySizeInByte = vertexArraySize*sizeof(float);
    this->texCoordArraySizeInByte = texCoordArraySize*sizeof(float);
    this->indexArraySizeInByte = indexArraySize*sizeof(unsigned char);*/

    this->setVertexArray(QuadDrawable::vertex, 3 * 4);
    this->setTexCoordArray(QuadDrawable::texCoord, 3 * 4);
    this->setIndexArray(QuadDrawable::index, 4);

    this->primitive = GL_QUADS;
}

QuadDrawable::~QuadDrawable()
{
}

}
